import ucApi from "@rc/apis/uc/index.mjs";

export default [
	{
		type: "remoteSelect",
		label: "上传人",
		key: "createUserId",
		default: User.getUser().userId,
		property: {
			placeholder: "请输入上传人姓名",
			clearable: true,
			options: [],
			props: {
				label: "label",
				value: "value"
			},
			remoteMethod(item, query) {
				if (StringUtil.hasLength(query)) {
					ucApi.queryUserList({
						data: { userName: query },
						success: ({ data }) => {
							item.options = data.map((i) => ({
								label: i.userName + " - " + i.schoolName,
								value: i.userId
							}));
						}
					});
				} else {
					item.options = [
						{
							label: User.getUser().userName + " - " + User.getUser().schoolName,
							value: User.getUser().userId
						}
					];
				}
			}
		}
	},
	{
		type: "input",
		label: "文件名称",
		key: "sourceFileName",
		property: {
			placeholder: "支持名称模糊查询"
		}
	},
	{
		type: "input",
		label: "vid",
		key: "videoVid",
		property: {
			placeholder: "请输入vid"
		}
	},
	{
		type: "select",
		label: "转码状态",
		data: Dictionary.get("ESCAPE_STATUS"),
		key: "escapeState",
		property: { clearable: true, placeholder: "请选择" }
	},
	{
		type: "select",
		label: "是否加密",
		data: {
			Y: "加密",
			N: "未加密"
		},
		key: "isEncryption",
		property: { clearable: true, placeholder: "请选择" }
	},
	{
		type: "rangePicker",
		label: "上传时间",
		key: "uploadDate",
		property: { 
			clearable: true, 
			placeholder: "请选择", 
			type: "daterange", 
			"startPlaceholder": "开始日期",
			"endPlaceholder": "结束日期",
			"value-format": "yyyy-MM-dd"
		}
	},
];
